package com.twu.biblioteca.model;

import com.twu.biblioteca.dao.memory.MemoryUserDao;

import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;

import static org.fest.assertions.api.Assertions.assertThat;

public class UserModelIT {

  private UserModel sut;

  @BeforeMethod
  public void setUp() throws Exception {
    sut = new UserModel(new MemoryUserDao());
  }

  @Test
  public void should_check_credential() throws Exception {
    // Given

    // When

    // Then
    assertThat(sut.checkCredential("111-1111", "password")).isTrue();
    assertThat(sut.checkCredential("111-1111", "wrong password")).isFalse();
  }
}
